export const BASIC_INFO_NAME = [
  'jobPositionVisible',
  'affiliatedVisible',
  'workUnitVisible',
  'operatingPostVisible',
  'userNameVisible',
  'userNumVisible'
];

const needOtherModelBasicInfoName = [
  'jobPositionVisible',
  'affiliatedVisible',
  'workUnitVisible',
  'operatingPostVisible'
];

export const needOtherModelCheck = (type: string) => needOtherModelBasicInfoName.includes(type);

export const checkOption = (type: string) => {
  const checkModel = {
    model: '',
    alias: ''
  };
  switch (type) {
    case 'userNameVisible':
      return {
        model: 'userName',
        alias: 'userName'
      };
    case 'userNumVisible':
      return {
        model: 'userNum',
        alias: 'userNum'
      };
    case 'jobPositionVisible':
      return {
        model: 'JobPosition',
        alias: 'jobPosition'
      };
    case 'affiliatedVisible':
      return {
        model: 'AffiliatedUnit',
        alias: 'affiliatedUnit'
      };
    case 'workUnitVisible':
      return {
        model: 'WorkUnit',
        alias: 'workUnit'
      };
    case 'operatingPostVisible':
      return {
        model: 'OperatingPost',
        alias: 'operatingPost'
      };
    default:
      return checkModel;
  }
};

export default BASIC_INFO_NAME;
